//
//  FWtwoController.m
//  pmmSS
//
//  Created by Mac book on 2017/9/5.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import "FWtwoController.h"
#import "BaseTabbarController.h"
#import "HomeViewController.h"


@interface FWtwoController ()

@property(nonatomic,strong)UILabel *registrationLabel,*loginLabel;

@end

@implementation FWtwoController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.userLabel.text = @"新密码";
    self.passwordLabel.text = @"确认密码";
    self.userNameTextfield.placeholder = @"请输入新密码";
    self.passWordTextfield.placeholder = @"请再次输入新密码";
    [self.loginBtn setTitle:@"确定" forState:UIControlStateNormal];


    WeakSelf(weakSelf);

    _registrationLabel = [HMLabel createLabelWithText:@"立即登录" andTextColor:[UIColor whiteColor] andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:15] andTextAlignment:NSTextAlignmentLeft];

    //设置可点击
    _registrationLabel.tag = 201;

    UITapGestureRecognizer *rec1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchLable:)];

    [_registrationLabel addGestureRecognizer:rec1];

    _registrationLabel.userInteractionEnabled=YES;

    [self.view addSubview:_registrationLabel];

    [_registrationLabel mas_makeConstraints:^(MASConstraintMaker *make) {

        make.left.mas_equalTo(10);
        make.top.equalTo(weakSelf.loginBtn.mas_bottom).offset(15);
        make.width.mas_equalTo(autoScaleW(75));
        make.height.mas_equalTo(autoScaleH(15));

    }];

    //------------**********------------


    _loginLabel = [HMLabel createLabelWithText:@"注册" andTextColor:[UIColor whiteColor] andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:15] andTextAlignment:NSTextAlignmentRight];


    _loginLabel.tag = 202;

    UITapGestureRecognizer *rec2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(touchLable:)];


    [_loginLabel addGestureRecognizer:rec2];
    _loginLabel.userInteractionEnabled=YES;

    [self.view addSubview:_loginLabel];

    [_loginLabel mas_makeConstraints:^(MASConstraintMaker *make) {

        make.right.mas_equalTo(-10);
        make.top.equalTo(weakSelf.loginBtn.mas_bottom).offset(15);
        make.width.mas_equalTo(autoScaleW(35));
        make.height.mas_equalTo(autoScaleH(15));

    }];


}


-(void)touchLable:(UITapGestureRecognizer *)rec{

    switch (rec.view.tag) {
        case 201:
        {



            BaseTabbarController *vc = [[BaseTabbarController alloc]init];

            [self presentViewController:vc animated:YES completion:nil];

        }
            break;

        case 202:
        {
            NSLog(@"点击了%ld",(long)rec.view.tag);

            [self dismissViewControllerAnimated:YES completion:nil];
            
        }
            break;
            
        default:
            break;
    }
    
    NSLog(@"点击了%ld",(long)rec.view.tag);
    
}


-(void)clickBtn:(UIButton *)button{


    BaseTabbarController *vc = [[BaseTabbarController alloc]init];

    [self presentViewController:vc animated:YES completion:nil];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
